package cn.gcjxsc.service.member;

import cn.gcjxsc.entity.member.Member;
import cn.gcjxsc.entity.member.WxMember;
import cn.gcjxsc.repository.member.MemberRepository;
import cn.gcjxsc.repository.member.WxMemberRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author pumbaa
 * @since 1.0
 */
@Service
public class MemberService {
    @Autowired
    private MemberRepository memberRepository;
    @Autowired
    private WxMemberRepository wxMemberRepository;

    /**
     * 根据id查询会员信息
     * @param id 会员id
     * @return
     */
    public Member findById(Integer id) {
        return memberRepository.findOne(id);
    }

    public List<Member> findByIds(List<Integer> ids) {
        return memberRepository.findAll(ids);
    }

    public WxMember findWxMemberById(Integer id) {
        return wxMemberRepository.findOne(id);
    }
}
